
You listen for specific packets coming from LFS telling you about the current state of the car (speed, acceleration, position etc.) and then send other packets telling the AI car what to do (turn the wheel, accelerate, brake etc.) in regular intervals like every 100 ms.